package cn.wizzer.app.cms.modules.models;

import cn.wizzer.framework.base.model.BaseModel;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;

import java.io.Serializable;

/**
 * @author zl
 * @date 2020/6/30 15:56
 */
@Table("cms_activity")
@Comment("活动")
@Data
@TableMeta("{mysql-charset:'utf8mb4'}")
public class CmsActivity extends BaseModel implements Serializable {

    @Column
    @Name
    @Comment("ID")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @PrevInsert(uu32 = true)
    private String id;

    @Column
    @Comment("活动图片")
    @ColDefine(type = ColType.VARCHAR, width = 128)
    private String picture;

    @Column
    @Comment("活动名称")
    @ColDefine(type = ColType.VARCHAR, width = 20)
    private String activityName;

    @Column
    @Comment("是否长期活动")
    @ColDefine(type = ColType.BOOLEAN)
    private Boolean isLongActivity;

    @Column
    @Comment("开始日期")
    @ColDefine(type = ColType.VARCHAR, width = 16)
    private String startDate;

    @Column
    @Comment("结束日期")
    @ColDefine(type = ColType.VARCHAR, width = 16)
    private String endDate;

    @Column
    @Comment("是否禁用")
    @ColDefine(type = ColType.BOOLEAN)
    @Default("0")
    private boolean disabled;

    @Column
    @Comment("内容")
    @ColDefine(type = ColType.TEXT)
    private String content;

    @Column
    @Comment("创建时间")
    @PrevInsert(els = @EL("$me.now()"))
    private Long ctAt;

}
